package cn.nawang.ebeim.client.task;

import cn.nawang.ebeim.client.dto.ClientDto;
import cn.nawang.ebeim.client.process.Process;
import cn.nawang.ebeim.client.service.ApiService;

import java.util.List;

/**
 * Created by GanJc on 2016/1/20.
 */
public class DataSourceTimerTask extends TimerTask  {

    private ClientDto clientDto ;


    public DataSourceTimerTask() {
    }

    public DataSourceTimerTask(ClientDto clientDto) {
        this.clientDto = clientDto;
    }

    public void setClientDto(ClientDto clientDto) {
        this.clientDto = clientDto;
    }

    public void execute() {
        //从api 获取 数据源列表
        List<Process> uploadProcesses =
                ApiService.getInstance().getUploadProcesses();
        // 加入 数据源备份队列
        clientDto.getUploadProcess().addAll(uploadProcesses);
        // 更新dataSourceBackUpTaskList状态为备份中
    }

}
